﻿using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using EntitySetBase;

namespace Models
{
    public class OrderDetail : EntitySetWithCreateAndUpdate
    {

        public OrderDetail()
        {
        }

        public int Count { get; set; }
        public string Name { get; set; }
        public decimal Price { get; set; }

        [Column("description"), MaxLength(1024)]
        public override string Description { get; set; }

        public new string UpdatedOn { get; set; }

        protected internal virtual string ProtectedProperty { get; set; }
        private string PriviateProperty { get; set; }

        public string OrderId { get; set; }
        public virtual Order Order { get; set; }

        /// <summary>
        /// 隐藏父类成员
        /// </summary>
        /// <param name="createdBy"></param>
        public new void Create(string createdBy = null)
        {
            base.Create(createdBy);
            Count = 1;
        }

        /// <summary>
        /// 方法的 override
        /// </summary>
        /// <param name="updatedBy"></param>
        public override void Update(string updatedBy = null)
        {
            base.Update(updatedBy);
        }

        /// <summary>
        /// 方法的重载
        /// </summary>
        public void Update()
        {

        }
    }
}
